I.Setup

Libraries needed: [Note: I wrote results hide but the ## are not results maybe??]

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(Seurat)
## Attaching SeuratObject
library(patchwork)

Loading data & Checking out how the loaded data looks like:

mouse.data <- Read10X(data.dir = "/home/xiaoyi/Documents/Praktikum/Bioinformatik/GSE113854_RAW")
#mouse.data <- Read10X(data.dir = "/Users/xiaoyizheng/Downloads/Praktikum/Bioinfo_Einarbeiten/CellChatSelf/mouse/GSE113854_RAW/")

mouse.data
##   [[ suppressing 32 column names 'AAACCTGAGAATTCCC-1', 'AAACCTGAGACCGGAT-1', 'AAACCTGAGACGCACA-1' ... ]]
##   [[ suppressing 32 column names 'AAACCTGAGAATTCCC-1', 'AAACCTGAGACCGGAT-1', 'AAACCTGAGACGCACA-1' ... ]]
##   [[ suppressing 32 column names 'AAACCTGAGAATTCCC-1', 'AAACCTGAGACCGGAT-1', 'AAACCTGAGACGCACA-1' ... ]]

Creating Seurat object:

mouse <- CreateSeuratObject(counts = mouse.data, project = "MoSk", min.cells = 3, min.features = 200)

II. Pre-processing

QC (quality control) Matrix for selection and filtration of cells, using user-defined criteria. In this case it is the mitochondrial genes as criteria. [note: apparently they all have same level of mt content. Maybe pre-processed already? or maybe that is not the proper criteria to choose in this case. Which one could be better instead of it?]

mouse[["percent.mt"]] <- PercentageFeatureSet(mouse, pattern = "^MT-") 

#Visualization by violin plot (mt percent no significance):
VlnPlot(mouse, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3) 
## Warning in SingleExIPlot(type = type, data = data[, x, drop = FALSE], idents =
## idents, : All cells have the same value of percent.mt.

Genes and total molecules calculated and stored in obj. meta data. Showing QC metrics for the first 5 cells:

head(mouse@meta.data, 5) 
##                    orig.ident nCount_RNA nFeature_RNA percent.mt
## AAACCTGAGAATTCCC-1       MoSk       1475          783          0
## AAACCTGAGACCGGAT-1       MoSk       4148         1624          0
## AAACCTGAGACGCACA-1       MoSk       3136         1342          0
## AAACCTGAGATGTGGC-1       MoSk       3138         1323          0
## AAACCTGAGCTGCGAA-1       MoSk       4029         1721          0
#examining a few genes in the first thirty cells
mouse.data[c("Igf2", "Cck", "Pf4"), 1:30] 
## 3 x 30 sparse Matrix of class "dgCMatrix"
##   [[ suppressing 30 column names 'AAACCTGAGAATTCCC-1', 'AAACCTGAGACCGGAT-1', 'AAACCTGAGACGCACA-1' ... ]]
##                                                                   
## Igf2 . . . . . 1 . .  . . . . . .  . . . 1 . . . . . . . . . . . .
## Cck  . . . . . . . .  . . . . . .  . . . . . . . . . . . . . . . .
## Pf4  . . . . . . . . 11 . . . . . 25 . . 1 1 . 1 1 . 1 . . . . . 2
#a few genes in the first 30 cells 
#picked "Igf2", "Cck", "Pf4" according to web

Visualization of feature-feature relationships

plot1 <- FeatureScatter(mouse, feature1 = "nCount_RNA", feature2 = "percent.mt") 
## Warning in cor(x = data[, 1], y = data[, 2]): the standard deviation is zero
#since all have same mt quality...

plot2 <- FeatureScatter(mouse, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")
#positively correlated

plot1 + plot2

III. Normalization

mouse <- NormalizeData(mouse, normalization.method = "LogNormalize", scale.factor = 10000)
#alt.:  mouse<- NormalizeData(mouse)

IV. Feature Selection

mouse <- FindVariableFeatures(mouse, selection.method = "vst", nfeatures = 2000)
top10 <- head(VariableFeatures(mouse), 10) # Identify the 10 most highly variable genes
top10
##  [1] "Hbb-bs" "Hba-a1" "Ccl21a" "Hbb-bt" "Saa3"   "Acp5"   "Ccl5"   "S100a8"
##  [9] "Mmp9"   "S100a9"
top20 <- head(VariableFeatures(mouse), 20) # Identify the 20 most highly variable genes
top20
##  [1] "Hbb-bs" "Hba-a1" "Ccl21a" "Hbb-bt" "Saa3"   "Acp5"   "Ccl5"   "S100a8"
##  [9] "Mmp9"   "S100a9" "Cma1"   "Cd74"   "Mmp3"   "Ccl17"  "Pf4"    "Apoe"  
## [17] "Lgals7" "Ctla2a" "Mgp"    "Hp"
plot1 <- VariableFeaturePlot(mouse)
plot2 <- LabelPoints(plot = plot1, points = top10, repel = TRUE)
## When using repel, set xnudge and ynudge to 0 for optimal results
plot1 + plot2

V. Scaling

all.genes <- rownames(mouse)
mouse <- ScaleData(mouse, features = all.genes)
## Centering and scaling data matrix
#optional: mouse <- ScaleData(mouse)

VI. Linear Dimension Reduction

Perform PCA

mouse <- RunPCA(mouse, features = VariableFeatures(object = mouse))
## PC_ 1 
## Positive:  Fth1, Tyrobp, Fcer1g, Lyz2, Ftl1, H2-D1, Tmsb4x, Ctss, C1qb, Apoe 
##     C1qa, C1qc, Ptpn18, Wfdc17, Cd52, Pf4, Laptm5, Lgals3, Ms4a7, Aif1 
##     Cd74, Clec4n, Ucp2, Lst1, Ms4a6c, Cd68, Id2, Alox5ap, Cd14, Fxyd5 
## Negative:  Col1a1, Col1a2, Col3a1, Sparc, Bgn, Col5a2, Dcn, Meg3, Postn, Col6a1 
##     Col6a2, Fstl1, Col12a1, Col5a1, Aebp1, Lum, Serpinh1, Mfap4, Col6a3, Mmp2 
##     Thbs2, Gpx3, Fbln2, Serpinf1, Tmsb10, Fn1, Lgals1, Lrrc15, Itm2a, Loxl1 
## PC_ 2 
## Positive:  Tyrobp, Fcer1g, Lyz2, Lgals3, C1qb, Ctss, Apoe, Ftl1, C1qa, Fth1 
##     C1qc, Pf4, Wfdc17, Ms4a7, Cd52, Lst1, Aif1, Cd74, Cstb, Laptm5 
##     Lgals1, Clec4n, Id2, Ifi27l2a, Cd68, Ms4a6c, Alox5ap, Cd14, Csf1r, Cyba 
## Negative:  Col4a1, Col4a2, Cdh5, Igfbp7, Pecam1, Egfl7, Crip2, Sparcl1, Plvap, Ramp2 
##     Col15a1, Col18a1, Cav1, Ctla2a, Emcn, Myct1, Kdr, Adgrf5, Adgrl4, Cd93 
##     Esam, Mcam, Ly6c1, Pdlim1, Cldn5, Fabp4, Mmrn2, Eng, Gng11, Aqp1 
## PC_ 3 
## Positive:  Cdh5, Pecam1, Ctla2a, Egfl7, Cd93, Ramp2, Cd34, Myct1, Kdr, Ly6c1 
##     Mfap4, S100a16, Igf1, Adgrl4, Emcn, Lum, Igfbp3, Mmrn2, Mest, Cldn5 
##     Ly6a, Ptn, Fbln2, Plvap, Aebp1, Tie1, Gja1, Ptprb, Gpihbp1, Rbp1 
## Negative:  Rgs5, Ndufa4l2, Gm13889, Higd1b, Des, Notch3, Serpine2, Cox4i2, Il6, Acta2 
##     Mylk, Cygb, Rasgrp2, Ebf1, Ppp1r14a, Mgp, Thy1, Crip1, Col4a1, Mustn1 
##     Pdgfa, Myl9, S100a4, Phlda1, Abcc9, Tppp3, Col4a2, Gucy1a3, Parm1, Actg2 
## PC_ 4 
## Positive:  Malat1, Il6, Cxcl1, Meg3, Serping1, Mt1, Gm13889, Rgs5, Col14a1, Sparcl1 
##     Errfi1, Ogn, Eln, Mt2, Nov, Neat1, Klf4, Clec3b, Ccl2, Col4a1 
##     Fmod, Procr, Ebf1, Col4a2, Fxyd1, H19, Id3, Tinagl1, Cygb, Fosb 
## Negative:  2810417H13Rik, Birc5, Ube2c, Stmn1, Top2a, Tuba1b, Cenpa, Hmgb2, Cdca3, H2afz 
##     Cks2, Ccnb2, Prc1, Cks1b, Ccna2, 2700094K13Rik, Cenpf, Cdk1, Smc2, Ccnb1 
##     Cdca8, Mki67, Nusap1, Tpx2, Lockd, Tubb5, Spc24, Tk1, H2afx, Cenpm 
## PC_ 5 
## Positive:  Pf4, Apoe, Sepp1, C1qc, C1qb, C1qa, Cxcl1, Neat1, Ctsd, Ms4a7 
##     Lyz2, Fosb, Klf4, Lgmn, Gas6, Cxcl2, Ier3, Syngr1, Ccl7, Mrc1 
##     H19, Ccl2, Ftl1, Igfbp4, Col14a1, Trem2, Igf1, Lst1, Eln, Slc40a1 
## Negative:  Tmsb10, S100a6, Ccr7, H2-Eb1, Ramp3, Samsn1, Crabp1, H2-Aa, H2-Ab1, Tmsb4x 
##     Klrd1, Icos, Bcl2a1d, Ptprcap, Napsa, Tbc1d4, Ifitm1, Cd209a, Cytip, Tnfrsf18 
##     AW112010, Cd52, H2-DMb1, H2-DMa, Cd74, Il1r2, Cd3d, Cd7, Tnfrsf4, Tnfrsf9

Examine and visualize PCA results a few different ways

print(mouse[["pca"]], dims = 1:5, nfeatures = 5)
## PC_ 1 
## Positive:  Fth1, Tyrobp, Fcer1g, Lyz2, Ftl1 
## Negative:  Col1a1, Col1a2, Col3a1, Sparc, Bgn 
## PC_ 2 
## Positive:  Tyrobp, Fcer1g, Lyz2, Lgals3, C1qb 
## Negative:  Col4a1, Col4a2, Cdh5, Igfbp7, Pecam1 
## PC_ 3 
## Positive:  Cdh5, Pecam1, Ctla2a, Egfl7, Cd93 
## Negative:  Rgs5, Ndufa4l2, Gm13889, Higd1b, Des 
## PC_ 4 
## Positive:  Malat1, Il6, Cxcl1, Meg3, Serping1 
## Negative:  2810417H13Rik, Birc5, Ube2c, Stmn1, Top2a 
## PC_ 5 
## Positive:  Pf4, Apoe, Sepp1, C1qc, C1qb 
## Negative:  Tmsb10, S100a6, Ccr7, H2-Eb1, Ramp3
VizDimLoadings(mouse, dims = 1:2, reduction = "pca")

DimPlot(mouse, reduction = "pca")

heatmap: exploration of the primary sources of heterogeneity -> decide which PCs to include for further downstream analyses

DimHeatmap(mouse, dims = 1, cells = 500, balanced = TRUE) #heatmap: exploration of the primary sources of heterogeneity

DimHeatmap(mouse, dims = 1:15, cells = 500, balanced = TRUE)

VII. Determination of Dimension

Metafeature: combines information across a correlated feature set. top principal components => robust compression how many PCs to take? ###JackStraw procedure permute subset of the data (1% by default) and rerun PCA significant PCs ~ strong enrichment of low p-value features

mouse <- JackStraw(mouse, num.replicate = 100)
mouse <- ScoreJackStraw(mouse, dims = 1:20)
JackStrawPlot(mouse, dims = 1:15)
## Warning: Removed 21000 rows containing missing values (`geom_point()`).

alternative heuristic method Elbow plot: observe where the elbow is and then see which PCs to choose

ElbowPlot(mouse)

# VIII. Clustering Cells

mouse <- FindNeighbors(mouse, dims = 1:10)
## Computing nearest neighbor graph
## Computing SNN
#mouse <- FindClusters(mouse, resolution = 0.5)
mouse <- FindClusters(mouse, resolution = 0.3) 
## Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
## 
## Number of nodes: 22322
## Number of edges: 716976
## 
## Running Louvain algorithm...
## Maximum modularity in 10 random starts: 0.9309
## Number of communities: 15
## Elapsed time: 3 seconds
#chosen resolution 0.3 here for retrieving 13 clusters 0-12 
# Look at cluster IDs of the first 5 cells
head(Idents(mouse), 5)
## AAACCTGAGAATTCCC-1 AAACCTGAGACCGGAT-1 AAACCTGAGACGCACA-1 AAACCTGAGATGTGGC-1 
##                  3                  9                  8                  0 
## AAACCTGAGCTGCGAA-1 
##                  5 
## Levels: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

IX. Non-linear Dimension Reduction

e.g. UMAP, tSNE

input to the UMAP and tSNE: same PCs as input to the clustering analysis

mouse <- RunUMAP(mouse, dims = 1:10)
## Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
## To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
## This message will be shown once per session
## 14:24:47 UMAP embedding parameters a = 0.9922 b = 1.112
## 14:24:47 Read 22322 rows and found 10 numeric columns
## 14:24:47 Using Annoy for neighbor search, n_neighbors = 30
## 14:24:47 Building Annoy index with metric = cosine, n_trees = 50
## 0%   10   20   30   40   50   60   70   80   90   100%
## [----|----|----|----|----|----|----|----|----|----|
## **************************************************|
## 14:24:49 Writing NN index file to temp file /tmp/Rtmp8EeFf6/file2e6e545a3099
## 14:24:49 Searching Annoy index using 1 thread, search_k = 3000
## 14:24:56 Annoy recall = 100%
## 14:24:56 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 30
## 14:24:56 Initializing from normalized Laplacian + noise (using irlba)
## 14:24:57 Commencing optimization for 200 epochs, with 918564 positive edges
## 14:25:05 Optimization finished
#note that you can set `label = TRUE` or use the LabelClusters function to help label individual clusters
DimPlot(mouse, reduction = "umap")

#saveRDS(mouse, file = "/Users/xiaoyizheng/Downloads/Bioinfo_Einarbeiten/CellChatSelf/mouse/output/mouseOutput.rds")

X. Cluster Biomarkers

Finding differentially expressed features

  • min.pct argument: requires a feature to be detected at a minimum percentage in either of the two groups of cells
  • thresh.test argument: requires a feature to be differentially expressed (on average) by some amount between the two groups
  • to speed up computations: max.cells.per.ident
#some violin plots to check on how the features (PCs) expressed in the corresponding clusters

cluster0.markers <- FindMarkers(mouse, ident.1 = 0, min.pct = 0.25)
## For a more efficient implementation of the Wilcoxon Rank Sum Test,
## (default method for FindMarkers) please install the limma package
## --------------------------------------------
## install.packages('BiocManager')
## BiocManager::install('limma')
## --------------------------------------------
## After installation of limma, Seurat will automatically use the more 
## efficient implementation (no further action necessary).
## This message will be shown once per session
head(cluster0.markers, n = 5)
##        p_val avg_log2FC pct.1 pct.2 p_val_adj
## Col3a1     0  0.6524410 1.000 0.955         0
## Col5a2     0  0.6328767 0.969 0.733         0
## Col6a3     0  0.6188054 0.952 0.726         0
## Tnn        0  0.9815336 0.507 0.239         0
## Fcer1g     0 -2.2622720 0.153 0.404         0
VlnPlot(mouse, features = c("Col3a1", "Col5a2", "Col6a3", "Tnn", "Col5a1")) #plot first 5

cluster1.markers <- FindMarkers(mouse, ident.1 = 1, min.pct = 0.25)
head(cluster1.markers, n = 5)
##         p_val avg_log2FC pct.1 pct.2 p_val_adj
## Col3a1      0  1.1273284 1.000 0.960         0
## Col5a2      0  0.8307832 0.982 0.760         0
## Fmod        0  1.2055963 0.311 0.059         0
## Angptl1     0  1.1364055 0.325 0.066         0
## Dpt         0  1.2583296 0.705 0.317         0
VlnPlot(mouse, features = c("Rpl7", "Rpl31", "Col3a1", "Col5a2", "Spats2l"))

cluster2.markers <- FindMarkers(mouse, ident.1 = 2, min.pct = 0.25)
head(cluster2.markers, n = 5)
##          p_val avg_log2FC pct.1 pct.2 p_val_adj
## Ptpn18       0   2.113765 0.567 0.152         0
## Col3a1       0  -2.869369 0.839 0.984         0
## Col5a2       0  -2.367420 0.254 0.867         0
## Fn1          0  -1.693357 0.282 0.825         0
## Serpine2     0  -1.940214 0.085 0.496         0
VlnPlot(mouse, features = c("Col3a1", "Des", "Serpine2", "Rgs5", "Rgs4"))

cluster3.markers <- FindMarkers(mouse, ident.1 = 3, min.pct = 0.25)
head(cluster3.markers, n = 5)
##          p_val avg_log2FC pct.1 pct.2 p_val_adj
## Des          0   2.002776 0.479 0.062         0
## Serpine2     0   2.284482 0.887 0.401         0
## Rgs5         0   3.390078 0.961 0.235         0
## Gm13889      0   2.771065 0.724 0.129         0
## Cox4i2       0   1.919825 0.384 0.052         0
VlnPlot(mouse, features = c("Col3a1", "Col5a2", "Selp", "F11r", "Cd34")) #"Selp", "F11r", "Cd34" very significant

cluster4.markers <- FindMarkers(mouse, ident.1 = 4, min.pct = 0.25)
head(cluster4.markers, n = 5)
##                p_val avg_log2FC pct.1 pct.2     p_val_adj
## Il1b    0.000000e+00  1.0356642 0.791 0.353  0.000000e+00
## Tyrobp  0.000000e+00  0.5569658 0.879 0.365  0.000000e+00
## Fcer1g 2.484663e-299  0.4255137 0.765 0.301 4.246289e-295
## Fth1   1.136707e-291  0.3869542 0.999 0.983 1.942632e-287
## Lyz2   6.863201e-278  0.3131246 0.756 0.359 1.172921e-273
VlnPlot(mouse, features = c("Col3a1", "Mdk", "Tmsb4x", "Eln", "Col1a2"))

cluster2.markers <- FindMarkers(mouse, ident.1 = 2, min.pct = 0.25)
head(cluster2.markers, n = 5)
##          p_val avg_log2FC pct.1 pct.2 p_val_adj
## Ptpn18       0   2.113765 0.567 0.152         0
## Col3a1       0  -2.869369 0.839 0.984         0
## Col5a2       0  -2.367420 0.254 0.867         0
## Fn1          0  -1.693357 0.282 0.825         0
## Serpine2     0  -1.940214 0.085 0.496         0
cluster5.markers <- FindMarkers(mouse, ident.1 = 5, ident.2 = c(0, 3), min.pct = 0.25)
head(cluster5.markers, n = 5)
##               p_val avg_log2FC pct.1 pct.2 p_val_adj
## 2700094K13Rik     0   1.384453 0.783 0.263         0
## Ccdc34            0   1.218645 0.559 0.118         0
## Ube2c             0   1.522594 0.405 0.027         0
## Cks1b             0   1.299158 0.634 0.165         0
## H2afz             0   1.588176 0.979 0.660         0
mouse.markers <- FindAllMarkers(mouse, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)  #No features pass logfc.threshold threshold, maybe threshold=0.1, 0.15, 0.2?
## Calculating cluster 0
## Calculating cluster 1
## Calculating cluster 2
## Calculating cluster 3
## Calculating cluster 4
## Calculating cluster 5
## Calculating cluster 6
## Calculating cluster 7
## Calculating cluster 8
## Calculating cluster 9
## Calculating cluster 10
## Calculating cluster 11
## Calculating cluster 12
## Calculating cluster 13
## Calculating cluster 14
mouse.markers <- FindAllMarkers(mouse, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.2) #0.2 is chosen here
## Calculating cluster 0
## Calculating cluster 1
## Calculating cluster 2
## Calculating cluster 3
## Calculating cluster 4
## Calculating cluster 5
## Calculating cluster 6
## Calculating cluster 7
## Calculating cluster 8
## Calculating cluster 9
## Calculating cluster 10
## Calculating cluster 11
## Calculating cluster 12
## Calculating cluster 13
## Calculating cluster 14
mouse.markers %>%
  group_by(cluster) %>%
  slice_max(n = 2, order_by = avg_log2FC)
## # A tibble: 30 × 7
## # Groups:   cluster [15]
##       p_val avg_log2FC pct.1 pct.2 p_val_adj cluster gene   
##       <dbl>      <dbl> <dbl> <dbl>     <dbl> <fct>   <chr>  
##  1 1.01e-71       1.58 0.283 0.181  1.72e-67 0       Saa3   
##  2 0              1.47 0.876 0.462  0        0       Crabp1 
##  3 0              2.13 0.901 0.411  0        1       Ptn    
##  4 0              2.05 0.786 0.312  0        1       H19    
##  5 0              4.15 0.813 0.431  0        2       Apoe   
##  6 0              4.12 0.692 0.258  0        2       Cd74   
##  7 0              3.39 0.961 0.235  0        3       Rgs5   
##  8 0              2.77 0.724 0.129  0        3       Gm13889
##  9 1.69e-52       1.20 0.296 0.165  2.90e-48 4       S100a8 
## 10 1.52e-56       1.16 0.287 0.153  2.59e-52 4       S100a9 
## # … with 20 more rows

Features in CellChat paper supplimentary Fig.2.b

VlnPlot(mouse, features = c("Crabp1", "Des", "Rgs5", "C1qb", "Pf4", "Eln", "Ogn", "Cd93", "Pecam1"))

VlnPlot(mouse, features = c("Birc5", "Ccnb2", "Icos", "Nkg7", "Ccr7", "H2-DMb1", "Hdc",  "G0s2", "Cadm4"))

VlnPlot(mouse, features = c("Itih5", "Hba-a2", "Hbb-bs", "Acp5", "Mmp9", "Ccl21a", "Lyve1"))

FeaturePlot shows the distribution of expression of features in the clusters

#found after PCA:
FeaturePlot(mouse, features = c("Sparc", "Tyrobp", "Igfbp7", "Pecam1", "Cd34", "Mfap4", "Ndufa4l2", "Il6",
                               "Birc5"))

#features from paper supplm. fig. 2.b
FeaturePlot(mouse, features = c("Crabp1", "Des", "Rgs5", "C1qb", "Pf4", "Eln", "Ogn", "Cd93", "Pecam1"))

FeaturePlot(mouse, features = c("Birc5", "Ccnb2", "Icos", "Nkg7", "Ccr7", "H2-DMb1", "Hdc",  "G0s2", "Cadm4"))

FeaturePlot(mouse, features = c("Itih5", "Hba-a2", "Hbb-bs", "Acp5", "Mmp9", "Ccl21a", "Lyve1"))

mouse.markers %>%
  group_by(cluster) %>%
  top_n(n = 10, wt = avg_log2FC) -> top10

#DoHeatmap(mouse, features = top10$gene) + NoLegend()
DoHeatmap(mouse, features = top10$gene) 

XI. Assigning Cell Type Identity to Clusters

alternative way to name IDs:

mouse <- RenameIdents(mouse, `0` = "0_FIB-1", `1` = "1_FIB-3", `2` = "2_MYL",
                      `3` = "3_FIB-2", `4` = "4_undecided", `5` = "5_LYME", `6` = "6_FIB-4", `7` = "7_undecided", `8` = "8_ENDO", `9` = "9_undecided",
                      `10` = "10_undecided", `11` = "11_SCH", `12` = "12_DEN")
DimPlot(mouse, label = TRUE)

Or directly writing tags

new.cluster.ids <- c(“FIB-1”, “FIB-3”, “MYL”, “FIB-2”, “4”, “ENDO or LYME”, “FIB-4”, “7”, “ENDO”, “9”, “10”, “SCH”, “DEN”) names(new.cluster.ids) <- levels(mouse) mouse <- RenameIdents(mouse, new.cluster.ids) DimPlot(mouse, reduction = “umap”, label = TRUE, pt.size = 0.5) #DimPlot(mouse, reduction = “umap”, label = TRUE, pt.size = 0.5) + NoLegend()

some maybe useful codes (not needed for right now):

#FindConservedMarkers(mouse, idents.1= [nr.] )
#Idents(mouse)
#RenameIdents(mouse, '[nr.]'= [celltype] )

dot plot to gain an overview:

markers.to.plot <- c("Crabp1", "Des", "Rgs5", "C1qb", "Pf4", "Eln", "Ogn", "Cd93", "Pecam1","Birc5", "Ccnb2", "Icos", "Nkg7", "Ccr7", "H2-DMb1", "Hdc",  "G0s2", "Cadm4", "Itih5", "Hba-a2", "Hbb-bs", "Acp5", "Mmp9", "Ccl21a", "Lyve1")
DotPlot(
  mouse,
  assay = NULL,
  features = markers.to.plot,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
) + RotatedAxis()